<template>
	<view>
	        <view class="uni-padding-wrap uni-common-mt">
	            <view class="uni-title uni-common-mt">
	            </view>
	            <view>
	                <scroll-view :scroll-top="scrollTop" scroll-y="true" class="scroll-Y" @scrolltoupper="upper" @scrolltolower="lower"
	                @scroll="scroll">
						<navigator :url="`/pages/index/blog/blog?id=${item.id}`" class="chat_data" v-for="(item,index) in blogData" :key="index">
	                      <view class="chat_view_pic">
	                            <image class="chat_header_pic" :src="item.label1"></image>
	                       </view>
	                     <view class="chat_info">
	                         <text class="chat_info_name">{{item.title}}</text>
	                         <text class="chat_info_msg detail_three">{{item.name}}</text>
	                     </view>
	                      <!-- <text class="chat_time">17:25</text> -->
	                    </navigator>
	                </scroll-view>
	            </view>
	            <!-- <view @tap="goTop" class="uni-link uni-center uni-common-mt">
	                点击这里返回顶部
	            </view> -->
	        </view>
	    </view>
</template>

<script>
	import http from '../../common/request.js'
	export default {
		onLoad(){
			this.getBlogList()
			// document.querySelector('.uni-page-head-hd').style.display = 'none'
		},
		mounted() {
			
		},
		data() {
			return {
				        pageNum:1,
				        blogData:[],
			            scrollTop: 0,
			            old: {
			                scrollTop: 0
			            }
			        }
		},
		methods: {
			onPullDownRefresh:function(){
			  
			 },
			 async getBlogList() {
			 				const res = await http.request({
			 					url: '/blog/page_blog_vo_admin?rows='+10+'&page='+this.pageNum,
			 					method:'POST',
			 					data:{}
			 				})
						
							this.blogData = res.data.data.records
			 			},
			upper: function(e) {
			            console.log(e)
			        },
			        lower: function(e) {
			            console.log(e)
			        },
			        scroll: function(e) {
			            console.log(e)
			            this.old.scrollTop = e.detail.scrollTop
			        },
			        goTop: function(e) {
			            this.scrollTop = this.old.scrollTop
			            this.$nextTick(function() {
			                this.scrollTop = 0
			            });
			            uni.showToast({
			                icon:"none",
			                title:"纵向滚动 scrollTop 值已被修改为 0"
			            })
			        }
		}
	}
</script>

<style>
.chat_data{
  border-radius: 5rpx;
  padding: 1%;
  margin-top: 2%;
  width: 90%;
  margin-left: 5%;
  margin-right: 5%;
  display: flex;
  justify-content: space-between;
}
.chat_header_pic{
  width: 110rpx;
  height: 110rpx;
}


.chat_view_pic{
  width: 20%;
}

.chat_info{
  float: left;
  width: 90%;
  margin-top: 3%;
  flex-direction: column;
  display: flex;
}

.line{
  margin-top: 10rpx;
  height: 1rpx;
  width: 100%;
  background-color: #D8D8D8;
}

.navigator{
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #FFE1FF;
  border-radius: 15rpx;
  color: #666;
}

.search_input{
  width: 90%;
  margin: 0 auto;
  height: 90rpx;
  padding: 10rpx;
 
}
.chat_time{
  width: 20%;
  margin-top: 5%;
  font-size: xx-small;
}
.detail_three{

	text-overflow: -o-ellipsis-lastline;
		overflow: hidden;				//溢出内容隐藏
		text-overflow: ellipsis;		//文本溢出部分用省略号表示
		display: -webkit-box;			//特别显示模式
		-webkit-line-clamp: 3;			//行数
		line-clamp: 3;					
		-webkit-box-orient: vertical;	//盒子中内容竖直排列
	
}

.chat_info_name{
  font-size: medium;
  font-weight: bold;
}
.chat_info_msg{
  font-size: x-small;
  color: darkkhaki;
}
</style>
